unit Thrad_SaveData;

interface

uses
  System.Classes,System.SysUtils,Class_KzThrad,Uni;

type
  TThradSaveData = class(TKzThrad)
  private
  public
    FUniC:TUniConnection;
  protected
    procedure Execute; override;
  end;

implementation

uses
  Class_KzDebug,Class_Prod;

{ TThradSaveData }

procedure TThradSaveData.Execute;
var
  I:Integer;
  cProd:TProd;
begin
  KzDebug.Started;
  KzDebug.TickLog('V1');

  try
    cProd:=TPROD.Create;
    for I := 0 to 99999 do
    begin
      cProd.PRODINDX:=I+180000;
      cProd.WHOBUILD:=1006;
      cProd.PRODNAME:='PRODNAME';
      cProd.PRODCODE:='PRODCODE';
      cProd.DATALEVL:=1;

      cProd.InsertDB(FUniC);
    end;
    KzDebug.TickLog('V2');
    GetMsgProgress(Class_KzThrad.CONST_THRAD_STAT_TRUE,[]);
  finally
    if cProd<>nil then FreeAndNil(cProd);
  end;

end;

end.
